<?php

namespace frontend\models;

use common\models\Comment;
use common\models\User;
use Yii;
use yii\base\Model;

/**
 * ContactForm is the model behind the contact form.
 */
class CommentForm extends Model
{
    public $content;
    public $post_id;


    /**
     * @inheritdoc
     */
    public function rules()
    {
        return [
            // name, email, subject and body are required
            ['content', 'required','message'=>'请输入评论内容'],
            ['post_id', 'required'],
            ['content', 'safe'],
            [['post_id'], 'integer'],
            [['content'], 'string', 'min' => 5,'message'=>'举报理由至少5个字符'],

        ];
    }

    /**
     * @inheritdoc
     */
    public function attributeLabels()
    {
        return [
            'reason' => '举报理由',
        ];
    }

    /**
     * Sends an email to the specified email address using the information collected by this model.
     *
     * @param  string  $email the target email address
     * @return boolean whether the email was sent
     */
    public function addComment()
    {
        if($this->validate()){

        }
    }
}
